<?php
	session_start();
	if (!isset($_SESSION['kiemtradangnhapthinguyet']) || $_SESSION['kiemtradangnhapthinguyet']!=1) {
		header('location: ../../index.php');
		die;
	}
		
	$table = $_GET["table"];
	$table_parent = $_GET["table_parent"];
	$field = $_GET["field"];
	$idparent = $_GET["idparent"];
	
	if ($table!="" && $table_parent!="" && $field!="" && $idparent!="") {
		settype($idparent, "int");
	
		require("../librarys/funs/classdb.php");
		$db = new db;
		$list_record = $db->get_by_parent_db($table, $table_parent, $field, $idparent);
		if (count($list_record)>0) {
			foreach ($list_record as $row) 
				echo "<option value='".$row['id']."'>".$row['ten_vi']."</option>";
		}
	}
?>
